package cn.tutu.blockchain.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.tutu.blockchain.common.MsgObj;
import cn.tutu.blockchain.rate.entity.Rate;
import cn.tutu.blockchain.rate.service.RateService;

@RestController
@RequestMapping("/rate")
public class RateController {

	@Autowired
	private RateService rateService;

	@RequestMapping("/getRate")
	public MsgObj getRate() {
		Rate rate = rateService.getNewRate();
		return MsgObj.buildSuccessObj(rate.getCkt() + ":" + rate.getRmb());
	}

}
